/**
 * 
 */
package com.laozhao.EasySales.business;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.laozhao.EasySales.model.UserModel;
import com.laozhao.dreamframe.dbmanager.DBFactory;
import com.laozhao.dreamframe.dbmanager.DataBaseManager;

/**
 * @author LaoZhao
 *
 */
public class SystemServer extends AbstractServer {

	/**
	 * 
	 */
	public SystemServer() {
		super();
	}

	public boolean loginOn(UserModel um) throws SQLException  {
		boolean conn = false;
		String sqlStr = "select t.passworld from exam.user t where t.userCode = '"+um.getUserName()+"'";
		DataBaseManager  dmmgr = DBFactory.getInstance();
		ResultSet rs = dmmgr.getResult(sqlStr);
		if(rs !=  null){
			while(rs.next()){
				if(um.getPassWorld().equals(rs.getString("passworld"))){
					conn = true;
					return conn;
				}
			}
		}
		return conn;
	}

	
}
